/**
 * Created by yoyoyk on 2017/7/18.
 */
import Relay from "react-relay";

export default class queryOrderIdMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { queryOrderId }`;
    }

    getVariables() {
        return {
            argsInput: {
                type:1,
                status:3,
                orderType:1,
                enId:this.props.enId
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on queryOrderIdPayload {
            queryOrderId {
                errorCode
                value
                totalResult
                orders{ 
                    deliverRequest
                   traderName
                   orderGoodsStyleNos
                   orderClassify
                   isOnlineBalance
                   oid
                   enId
                   partAPhone
                   rmark
                   orderType
                   goodsInfo
                   createDate
                   status
                   partA
                   orderGoodsNum
                   partAName
                   payAccount
                   account
                   partB
                   partBName
                   partBUserName
                   partBPhone
                   partBUserId
                   partBAddress
                   partBAddress
                   remainOrderGoodsNum
                   orderGoodss{
                     styleNo
                     quantity
                   }
                   orderOperates{
                        status
                   }
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
               fragment on queryOrderIdPayload {
                        queryOrderId {
                            errorCode
                            value
                            totalResult
                            orders{
                              deliverRequest
                              traderName
                              orderGoodsStyleNos
                              orderClassify
                              isOnlineBalance
                               oid
                               enId
                               partAPhone
                               rmark
                               orderType
                               goodsInfo
                               createDate
                               status
                               partA
                               orderGoodsNum
                               partAName
                               payAccount
                               account
                               partB
                               partBName
                               partBUserName
                               partBPhone
                               partBUserId
                               partBAddress
                               partBAddress
                               remainOrderGoodsNum
                               orderGoodss{
                                 styleNo
                                 quantity
                               }
                               orderOperates{
                                    status
                                    toId
                               }
                            }
                        }
                }
            `]
        }];
    }

}
